﻿using System;

namespace Wombat.Core.Services
{
    /// <summary>
    /// Provides the functionality to manage state of tags.
    /// Such service is essential if calculating the current state is dependent to the
    /// previous state; for example linear interpolation.
    /// </summary>
    public interface ITagStateService
    {
        /// <summary>
        /// Tries the get tag value at the given time.
        /// </summary>
        /// <param name="tagId">The tag id.</param>
        /// <param name="time">The time.</param>
        /// <param name="tagValue">The tag value.</param>
        /// <returns>Returns true if a value could be returned (including null), or false if no value could be returned.</returns>
        bool TryGetTagValueAt(Guid tagId, DateTime time, out object tagValue);
        /// <summary>
        /// Sets the tag value.
        /// </summary>
        /// <param name="tagId">The tag id.</param>
        /// <param name="time">The time.</param>
        /// <param name="tagValue">The tag value.</param>
        void SetTagValue(Guid tagId, DateTime time, object tagValue);
        /// <summary>
        /// Defines that the tag value at a given time is corrupt.
        /// </summary>
        /// <param name="tagId">The tag id.</param>
        /// <param name="time">The given time.</param>
        void CorruptTagValue(Guid tagId, DateTime time);
    }
}